package com.bzyd.ss.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 统一页面跳转接口
 */
@Controller
@RequestMapping("/page")
public class PageController {

    @RequestMapping("/toLogin")
    public String toLogin(){
        return "login";
    }

    @RequestMapping("/toMain") //Security请求转发使用POST请求
    public String toMain(){
        return "main";
    }

    @RequestMapping("/toFailure")
    public String toFailure(Model model){
        // 是否登录失败
        model.addAttribute("loginFail","T");
        return "login";
    }
}
